package cn.itcast.ssm.controller;

import cn.itcast.ssm.exception.CustomException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Description:
 * 测试的时候，需要先登录，防止被拦截器拦截。
 * Created by E460 on 2017/11/21.
 */
@Controller
@RequestMapping("/exceptionTest")
public class ExceptionTest {

    @RequestMapping("/catchUnknownException.action")
    public String catchUnkownException()  throws RuntimeException {
        throw new RuntimeException("未知异常");

    }

    @RequestMapping("/catchCustomException.action")
    public String catchCustomException() throws CustomException {
        throw new CustomException("自定义异常");

    }
}
